﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace VISS.API.Users {

    /// <summary>
    /// This interface is used for VISS.VN
    /// Used this interface to implement operations on UserFollower table
    /// </summary>
    public interface IUserFollower {

        /// <summary>
        /// Inserts the specified item.
        /// </summary>
        /// <param name="item">The UserFollowerEnt item.</param>
        /// <returns>Return true if success, otherwise return false</returns>
        bool Insert(UserFollowerEnt item);
        /// <summary>
        /// Deletes the specified follower user key.
        /// </summary>
        /// <param name="followerUserKey">The follower user key.</param>
        /// <param name="followedUserKey">The followed user key.</param>
        /// <returns>Return true if success, otherwise return false</returns>
        bool Delete(string followerUserKey, string followedUserKey);

        /// <summary>
        /// Gets by follower user key.
        /// </summary>
        /// <param name="followerUserKey">The follower user key.</param>
        /// <returns>Return list of UserFollowerEnt if exists, otherwise return empty list</returns>
        List<UserFollowerEnt> GetByFollowerUserKey(string followerUserKey);
        /// <summary>
        /// Gets the by followed user key with paging.
        /// </summary>
        /// <param name="followedUserKey">The followed user key.</param>
        /// <param name="page">The page number.</param>
        /// <param name="recordPerPage">The record per page.</param>
        /// <param name="totalRecord">The total record.</param>
        /// <returns>Return list of UserFollowerEnt if exists, otherwise return empty list</returns>
        List<UserFollowerEnt> GetByFollowedUserKeyWithPaging(string followedUserKey, int page, int recordPerPage, out int totalRecord);

        /// <summary>
        /// Counts by followed user key.
        /// </summary>
        /// <param name="followedUserKey">The followed user key.</param>
        /// <returns>the follower count</returns>
        int CountByFollowedUserKey(string followedUserKey);
        /// <summary>
        /// Counts the by follower user key.
        /// </summary>
        /// <param name="followerUserKey">The follower user key.</param>
        /// <returns>the followed count</returns>
        int CountByFollowerUserKey(string followerUserKey);
        /// <summary>
        /// Checks if user A followed user B exist.
        /// </summary>
        /// <param name="followerUserKey">The follower user key.</param>
        /// <param name="followedUserKey">The followed user key.</param>
        /// <returns>Return true if exists, otherwise return false</returns>
        bool CheckExist(string followerUserKey, string followedUserKey);
    }
}
